# -*- coding: utf-8 -*-
# @Author : HaleShi
# @Time : 2023-07-10
# @File : 4_hook_password.py


import frida
import sys

rdev = frida.get_remote_device()
session = rdev.attach("大商天狗")

scr = """
Java.perform(function () {
    var h = Java.use("com.kh.keyboard.h");
    h.d.implementation = function (str,str2,str3) {
        console.log("---------------------")
        console.log("这是参数str:",str);
        console.log("这是参数str2:",str2);
        console.log("这是参数str3:",str3);
        var res = this.d(str,str2,str3);
        console.log(res);
        return res;
    };
});
"""
script = session.create_script(scr)


def on_message(message, data):
    print(message, data)


script.on("message", on_message)

script.load()
sys.stdin.read()